package GUI;

import java.util.ArrayList;

import Control.Season;
import processing.core.PImage;


class SeasonButton extends Component
{
	
	////////////////////////////////////////////////////////////////////////////////////////////////////
	public SeasonButton(Season s)
	{
		width =  165;
		height = 25;
		this.s = s;
		label = this.s.getName();
	}

	public void draw()
	{
		Utils.globalProcessing.textFont(Utils.plotFont, 19);
		int cx = x;
		int cy = y;
		if(label != null)
		{
			Utils.globalProcessing.textAlign(Utils.globalProcessing.LEFT);

			if(mouseOver()) 
			{
				super.draw();
				if(Utils.globalProcessing.mousePressed)
				{

					Utils.gu.drawVGradient(x, y + height, width, -height, Utils.globalProcessing.color(150, 150, 180), 80, Utils.globalProcessing.color(150, 150, 180), 255, (float)0.8);    
					Utils.gu.drawBox(x, y, width, height, 0, Utils.globalProcessing.color(150, 150, 200), 255);
					Utils.gu.drawBox(x, y, width, height, 1, Utils.globalProcessing.color(150, 150, 200), 150);
					cx += 2;
					cy += 2;
					
					Utils.startEpisodeSelected = Utils.firstOfSeason.get(s.getNumber()-1);
					Utils.endEpisodeSelected =  Utils.firstOfSeason.get(s.getNumber()-1);
					Utils.hs.modifySliders(Utils.firstOfSeason.get(s.getNumber()-1));
					Utils.graphArea.seasonEpisodeButton.state =false;
					Utils.graphArea.createLineGraphPoints();
					Utils.graphArea.seasonEpisodeButton.label=Utils.graphArea.seasonEpisodeButton.label2;

				}
			}

			Utils.globalProcessing.strokeWeight(1);
			Utils.globalProcessing.fill(255);
			Utils.globalProcessing.text(label, cx + 5, cy + 17);

		}
	}

	////////////////////////////////////////////////////////////////////////////////////////////////////
	String label;
	Season s;
}